<?php

        $cryptinstall="crypt/cryptographp.fct.php";
        include $cryptinstall; 

?>

<h1>Créer un compte</h1>


<div class="div_form">

	<div id="display_error_create" class="display_error hidden"> 
		<!-- On affiche ici les eventuels messages d'erreurs -->
	</div>
    <form id="form_create_account" method="POST" >
	<div class="form_left">
		<span class="petit italique">Les champs marqués d'un * sont obligatoires pour s'inscrire.</span>
		<ul>
			<li>
				<label class="desc" for="pseudo">Pseudo *</label>
				<input id="pseudo" name="pseudo" class="field text large" type="text" value=""/>
			</li>
			<li>
				<label class="desc" for="prenom">Prénom</label>
				<input id="prenom" name="prenom" class="field text large" type="text" value=""/>
			</li>
			<li>
				<label class="desc" for="nom">Nom</label>
				<input id="nom" name="nom" class="field text large" type="text" value=""/>
			</li>
			<li>
				<label class="desc" for="email">Adresse Mail *</label>
				<input id="email" name="email" class="field text large" type="text" value=""/>
			</li>
		</ul>
	</div>
	<div class="form_right">
		<ul>
			<li>
				<label class="desc" for="pass1">Mot de passe *</label>
				<input id="pass1" name="pass1" class="field text large" type="password" value=""/>
			</li>
			<li>
				<label class="desc" for="pass2">Confirmer le mot de passe *</label>
				<input id="pass2" name="pass2" class="field text large" type="password" value="" />
			</li>
			<li>
					<label class="desc" for="captcha">Veuillez saisir le code de sécurité *</label>

							<?php 
								
								dsp_crypt(0,1); 
							?>
							<td>
								<input id="captcha" name="captcha" class="field text" type="text" value="" />
							</td>
							</tr>
							</table>
			</li>
		
			<li class="form_buttons">
					<button class="negative button" onClick="JavaScript: $(document).trigger('close.facebox')">
					<img src="images/wrong.png" alt=""/> Annuler</button>   
			     
					<button id="submitButton" class="positive button" type="submit">
					<img src="images/ok.png" alt="" /> Créer mon compte !</button>
			</li>
		
		</ul>
	</div>	
    </form>
    <script type="text/javascript" >
            
        //desactive le comportement par defaut du formulaire et lance la fonction log_in()
        $('#form_create_account').submit(function(event){
            event.preventDefault();
            create_account();
        });
        
    $('#form_create_account').keypress(function(e){
        if(e.keyCode == 13){
            e.preventDefault();
            console.log('keypress');
            this.submit(); 
        }
    });
        
    </script>
</div>